package com.woniuxy.dudugua.service.impl;

import com.woniuxy.dudugua.entity.Product;
import com.woniuxy.dudugua.mapper.ProductMapper;
import com.woniuxy.dudugua.service.ProductsService;
import com.woniuxy.dudugua.util.view.*;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductsServiceImpl  implements ProductsService {
    @Resource
    public ProductMapper  productMapper;
    @Override
    public List<ProductAllView> selectByProuct() throws Exception {
        List<ProductAllView> productAllViews = productMapper.selectByProuct();
        if(productAllViews!=null){
            return   productAllViews;
        }
        return null;
    }

    @Override
    public List<ProductSkinCare> selectByProductSkinCare() throws Exception {
        List<ProductSkinCare> productSkinCares = productMapper.selectByProductSkinCare();
        if(productSkinCares!=null){
            return   productSkinCares;
        }
        return null;
    }

    @Override
    public List<ProductTattoView> selectByProductTatto() throws Exception {
        List<ProductTattoView> productTattoViews = productMapper.selectByProductTatto();
        if(productTattoViews!=null){
            return   productTattoViews;
        }
        return null;
    }

    @Override
    public List<ProductCosmetics> selectByProductCosmetics() throws Exception {
        List<ProductCosmetics> productCosmetics = productMapper.selectByProductCosmetics();
        if(productCosmetics!=null){
            return   productCosmetics;
        }
        return null;
    }

    @Override
    public List<ProductLearningTool> selectByProductLearningTool() throws Exception {
        List<ProductLearningTool> productLearningTools = productMapper.selectByProductLearningTool();
        if(productLearningTools!=null){
            return  productLearningTools;
        }
        return null;
    }
}
